package designMode.commandPattern;

/**
 * @ClassName AllCommand
 * @Description
 * @Author LIBOFEI
 * @Date 2020/6/24 23:23
 * @Version 1.0
 **/
public class AllCommand implements Command {

    Command[] commands;

    public AllCommand(Command[] commands){
        this.commands = commands;
    }

    @Override
    public void execute() {
        for(Command c : commands){
            c.execute();
        }
    }

    @Override
    public void undo() {
        for(Command c : commands){
            c.undo();
        }
    }
}
